package com.sx.pipeline.repos.http.service

import com.sx.pipeline.app.config.BaseEntity
import com.sx.pipeline.repos.http.req.DistrictBorderDTO
import com.sx.pipeline.repos.http.res.Ipage
import com.sx.pipeline.repos.http.res.TerritoryVO
import com.sx.pipeline.utils.kml.FileParseBean
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.*

/**
 * @Author: YY
 * @Date: 2022/8/4
 * @Desc: TODO
 */
interface IMapService {

    /**
     * 添加负责区域
     */
    @POST("/api/ums/area/app")
    fun addTerritory(@Body dto: FileParseBean): Observable<BaseEntity<Any>>

    /**
     * 获取区域列表
     */
    @GET("/api/ums/area/page")
    fun getTerritoryList(
        @Query("type") type: Int,
        @Query("page") page: Int,
        @Query("limit") limit: Int = 10,
        @Query("isPage") isPage: Boolean = true
    ): Observable<BaseEntity<Ipage<TerritoryVO>>>

    /**
     * 删除用户管辖区域
     */
    @POST("/api/ums/area/delete/{id}")
    fun deleteTerritory(@Path("id") id: Long): Observable<BaseEntity<Any>>

    /**
     * 添加行政区域负责区域
     */
    @POST("/api/system/area/administrativeAdd")
    fun addDistrictBorder(@Body dto: DistrictBorderDTO): Observable<BaseEntity<Any>>

    /**
     * 获取行政区域
     */
    @GET("/api/system/area/page")
    fun getDistrictBorderList(
        @Query("page") page: Int,
        @Query("limit") limit: Int = 10,
        @Query("isPage") isPage: Boolean = true
    ): Observable<BaseEntity<Ipage<DistrictBorderDTO>>>

    /**
     * 删除行政区域
     */
    @DELETE("/api/system/area/delete/{id}")
    fun deleteDistrictBorder(@Path("id") id: Long): Observable<BaseEntity<Any>>
}